// swift-tools-version: 6.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "spm_yasee",
    platforms: [
        .iOS(.v13)
    ],
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "spm_yasee",
            targets: ["spm_yasee"]),
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        // Targets can depend on other targets in this package and products from dependencies.
        .binaryTarget(
            name: "HlwToYasiSDK",
            path: "Sources/spm_yasee/frameworks/HlwToYasiSDK.xcframework"
        ),
        .binaryTarget(
            name: "ICBleProtocol",
            path: "Sources/spm_yasee/frameworks/ICBleProtocol.xcframework"
        ),
        .binaryTarget(
            name: "ICBodyFatAlgorithms",
            path: "Sources/spm_yasee/frameworks/ICBodyFatAlgorithms.xcframework"
        ),
        .binaryTarget(
            name: "ICDeviceManager",
            path: "Sources/spm_yasee/frameworks/ICDeviceManager.xcframework"
        ),
        .binaryTarget(
            name: "ICLogger",
            path: "Sources/spm_yasee/frameworks/ICLogger.xcframework"
        ),
//        .binaryTarget(
//            name: "MedicalTest",
//            path: "Sources/spm_yasee/frameworks/MedicalTest.framework"
//        ),
//        .binaryTarget(
//            name: "opencv2",
//            path: "Sources/spm_yasee/frameworks/opencv2.framework"
//        ),
//        .binaryTarget(
//            name: "ZXingObjC",
//            path: "Sources/spm_yasee/frameworks/ZXingObjC.framework"
//        ),
        .binaryTarget(
            name: "yasee_ios",
            path: "Sources/spm_yasee/frameworks/yasee_ios.xcframework"
        ),
        .target(
            name: "spm_yasee",
            dependencies: [
                "HlwToYasiSDK",
                "ICBleProtocol",
                "ICBodyFatAlgorithms",
                "ICDeviceManager",
                "ICLogger",
                "yasee_ios"
            ],
            path: "Sources/spm_yasee",
//            publicHeadersPath: ".", // 如果是 Objective-C
            cSettings: [
                .headerSearchPath("../frameworks"),
                .define("MODULE", to: "YES")
            ],
            linkerSettings: [
                .linkedLibrary("z"),
                .linkedLibrary("c++"),
            ]
        ),
        .testTarget(
            name: "spm_yaseeTests",
            dependencies: ["spm_yasee"]
        ),
    ]
)
